home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19971216-19980424 / 000329_news@newsmaster….columbia.edu _Mon Mar 23 17:53:17 1998.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id RAA27815
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 23 Mar 1998 17:53:17 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id RAA28167
  7.     for kermit.misc@watsun; Mon, 23 Mar 1998 17:53:16 -0500 (EST)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Help with simple script...
  12. Date: 23 Mar 1998 22:53:15 GMT
  13. Organization: Columbia University
  14. Lines: 78
  15. Message-ID: <6f6p4r$g7o$1@apakabar.cc.columbia.edu>
  16. References: <6f6ncm$oku@panix3.panix.com>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Xref: news.columbia.edu comp.protocols.kermit.misc:8527
  19.  
  20. In article <6f6ncm$oku@panix3.panix.com>,
  21. Greg Vilardi <vilardi@panix.com> wrote:
  22. : Hi everyone. I am having a problem writing a simple kermit script to take a
  23. : flatfile of command records and spit them out to a remote serial device. The
  24. : technical details are as follows: C-Kermit v6.0.192 SCO Unix 3.2v4.2
  25. : connected to a CX DigiBoard. The remote system is on a dedicated line,
  26. : directly connected and standard RS232 connectivity is working fine.
  27. Using what kind of flow control?
  28.  
  29. : I need to have a script that will take each line of a file, and send it out
  30. : the serial port. The script will then wait for a response from the port, and
  31. : log both the command and the response to another file. If some kind person
  32. : out there already has a script that does this or something very similar,
  33. : could you please e-mail it to me? Or could someone who knows more about
  34. : scripting than I do please tell me what is wrong with the script below? I've
  35. : spent most of the weekend with the kermit manuals and have had no luck. I
  36. : tried the FAQ too.  Suggestions to RTFM greatfully accepted if page numbers
  37. : are provided. I have read chapters 17, 18 & 19 3 times already.
  38. : ...
  39. : Script starts below:
  40. : ; Read file $1 one line at a time and send command to paging terminal on port
  41. : ; $3. Write return messages to $2.
  42. : def UPDATE {
  43. :     local \%c cmd
  44. :     if < \v(argc) 4 end 1 Usage: UPDATE infile outfile device
  45. :     ;set take error off
  46. :     set carrier-watch off
  47. :     OPEN READ \%1
  48. :     if fail end 1 Can't open \%1 for reading.
  49. :     open write \%2
  50. :     if fail end 1 Can't open \%2 for writing.
  51. :     set line \%3
  52. :     if fail end 1 Cant open port \%3
  53. :     set speed 9600
  54. :
  55. C-Kermit defaults to Xon/Xoff flow control.  Is that what you want to
  56. use?  If so, is the other system set up for it too?
  57.  
  58. :     set input silence 2
  59. :     set input timeout-action proceed
  60. :     set input echo off
  61. :     define \%c 0
  62. :     while true {
  63. :         read cmd
  64. :         xif fail {
  65. :             close write 
  66. :             end 0 Commands processed: \%c.
  67. :         }
  68. :         increment \%c
  69. : ;        writeln debug-log \m(cmd) \m(\%c)
  70. :         output \m(cmd) \13\10
  71. :         input 10 \10
  72. :         xif fail {
  73. :             close read
  74. :             close write
  75. :             end 1 Terminal did not respond.
  76. :         }
  77. :         writeln file \m(cmd)
  78. :         writeln file \v(input)
  79. :     }
  80. : }
  81. : log debug debug.log
  82. : update termrecs termrecs.out /dev/ttya01
  83. : close debug
  84.  
  85. That's a very well-written script, using all the appropriate mechanisms
  86. and using them correctly; nothing stands out as suspect.
  87.  
  88. So in what way does it not work?  What, exactly are the symptoms?
  89. Do any lines get through?  Do you ever get a LF back from the terminal?
  90.  
  91. In other words, is it a basic connectivity problem, or a problem with
  92. the execution of the script?
  93.  
  94. - Frank